package vip.liux.gateway.filters.decrypt;

/**
 * 错误码定义
 */
public enum ErrorCode {
    MISSING_PARAM(40001, "缺少必要参数"),
    DECRYPT_FAIL(40002, "enc_param解密失败"),
    SIGN_FAIL(40101, "签名校验不通过"),
    REPLAY_OR_TIMEOUT(40102, "请求超时或重复请求"),
    NO_KEY_CONFIG(40103, "未找到appId对应的密钥配置"),
    RESPONSE_ENCRYPT_FAIL(50001, "响应加密签名失败");

    private final int code;
    private final String defaultMsg;

    ErrorCode(int code, String defaultMsg) {
        this.code = code;
        this.defaultMsg = defaultMsg;
    }

    public int code() {
        return code;
    }

    public String defaultMsg() {
        return defaultMsg;
    }
}